﻿#pragma once
#include "camera.h"

#include <mmind/MechEyeApi.h>
#include <opencv2/opencv.hpp>

class CameraMMind : public Camera
{
public:
	CameraMMind();
	~CameraMMind();

	/*相机初始化接口*/
	virtual int CameraInit(const CameraParam& param);
	/*触发拍照接口*/
	virtual bool SnapPicture(QString& rgb, QString& depth);

private:
	void LoadMMindCameraDevInfo();
	bool SetImagAligmentParam();
	bool CreatePicturePath(const QString &path);
	bool SnapImage(int index);
	// 将深度图投影到彩色图范围
	cv::Mat ProjectionDepth2Color(const cv::Mat& depth, const int& iImageRows, const int& iImageClos);

private:
	QString m_ip;
	QString m_id;
	mmind::api::MechEyeDevice* m_mmind = nullptr;
	QString m_savePath = {};

	//相机参数信息
	cv::Mat m_depthIntrinsic;
	cv::Mat m_depthDistortion;
	cv::Mat m_rgbIntrinsic;
	cv::Mat m_rgbDistortion;
	cv::Mat m_rgbExtrinsic;
};
